/**
 * Created by Administrator on 2017/3/27 0027.
 */
Page2= {
    Create: function () {
        var page = {};


        var map;
        map = arr_texture[6];
        var picG = new THREE.PlaneGeometry(214, 33, 1, 1);
        var picM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var pic1 = new THREE.Mesh(picG, picM);

        map = arr_texture[7];
        var picG = new THREE.PlaneGeometry(382, 18, 1, 1);
        var picM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var pic2 = new THREE.Mesh(picG, picM);

        map = arr_texture[8];
        var picG = new THREE.PlaneGeometry(332, 18, 1, 1);
        var picM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var pic3 = new THREE.Mesh(picG, picM);

        map = arr_texture[9];
        var picG = new THREE.PlaneGeometry(115, 294, 1, 1);
        var picM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var pic4 = new THREE.Mesh(picG, picM);

        map = arr_texture[10];
        var picG = new THREE.PlaneGeometry(253, 76, 1, 1);
        var picM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var pic5 = new THREE.Mesh(picG, picM);

        map = arr_texture[11];
        var bgG = new THREE.PlaneGeometry(1136, 740, 1, 1);
        var bgM = new THREE.MeshBasicMaterial({map: map, transparent: true, side: THREE.DoubleSide});
        var bg = new THREE.Mesh(bgG, bgM);
        scene.add(bg);
        bg.position.z=-600;
        bg.scale.x=4.5;bg.scale.y=4.5;
        bg.material.opacity=0;

        var picG=new THREE.PlaneGeometry(60*1,60*1,1,1);
        var picM=new THREE.MeshBasicMaterial({map:tip_textrue,transparent:true,side:THREE.DoubleSide});
        var pic7=new THREE.Mesh(picG,picM);

        pic1.position.set(0, 80, 300);
        pic2.position.set(0, -25, 255);
        pic3.position.set(0, -55, 200);
        pic4.position.set(0, 100, 100);
        pic5.position.set(0, -120, 50);
        pic7.position.set(0, -250, 50);
        pic1.material.opacity = 0;
        pic2.material.opacity = 0;
        pic3.material.opacity = 0;
        pic4.material.opacity = 0;
        pic5.material.opacity = 0;
        pic7.material.opacity = 0;


        pic1.scale.x = pic1.scale.y = 0.6;
        pic2.scale.x = pic2.scale.y = 0.6;
        pic3.scale.x = pic3.scale.y = 0.6;

        pic4.scale.x = 1.0;
        pic4.scale.y = 1.0;
        pic5.scale.x = 1.0;
        pic5.scale.y = 1.0;


        scene.add(pic1);
        scene.add(pic2);
        scene.add(pic3);
        scene.add(pic4);
        scene.add(pic5);
        scene.add(pic7);


        page.start = function () {

            renderer.setClearColor(0xffffff);

            pic1.position.y += 10;
            pic2.position.y += 10;
            pic3.position.y += 10;
            TweenMax.to(pic1.position, 0.7, {delay: 0, y: pic1.position.y - 10, ease: Cubic.easeOut});
            TweenMax.to(pic2.position, 0.7, {delay: 0.3, y: pic2.position.y - 10, ease: Cubic.easeOut});
            TweenMax.to(pic3.position, 0.7, {delay: 0.6, y: pic3.position.y - 10, ease: Cubic.easeOut});
            TweenMax.to(pic1.material, 0.7, {delay: 0, opacity: 1, ease: Cubic.easeOut});
            TweenMax.to(pic2.material, 0.7, {delay: 0.3, opacity: 1, ease: Cubic.easeOut});
            TweenMax.to(pic3.material, 0.7, {delay: 0.6, opacity: 1, ease: Cubic.easeOut});


            TweenMax.to(pic4.scale, 0.6, {delay: 0.9, x: 0.8, y: 0.8, ease: Cubic.easeOut});
            TweenMax.to(pic5.scale, 0.6, {delay: 1.2, x: 1, y: 1, ease: Cubic.easeOut});
            TweenMax.to(pic4.material, 0.6, {delay: 0.9, opacity: 1, ease: Cubic.easeOut});
            TweenMax.to(pic5.material, 0.6, {delay: 1.2, opacity: 1, ease: Cubic.easeOut});
            TweenMax.to(pic7.material, 0.6, {delay: 1.5, opacity: 1, ease: Cubic.easeOut});
            TweenMax.to(bg.material, 0.6, {delay:0.5, opacity: 1, ease: Cubic.easeOut});
            bg.position.z=-000;
            TweenMax.to(bg.position, 1, {delay:0, z: -900, ease: Cubic.easeOut});


        }
        page.end = function () {
            TweenMax.to(pic1.material, 0.6, {delay: 0.2, opacity: 0, ease: Cubic.easeOut});
            TweenMax.to(pic2.material, 0.6, {delay: 0.4, opacity: 0, ease: Cubic.easeOut});
            TweenMax.to(pic3.material, 0.6, {delay: 0.6, opacity: 0, ease: Cubic.easeOut});
            TweenMax.to(pic4.material, 0.6, {delay: 0.8, opacity: 0, ease: Cubic.easeOut});
            TweenMax.to(pic5.material, 0.6, {delay: 1, opacity: 0, ease: Cubic.easeOut});
            TweenMax.to(pic7.material, 0.6, {delay: 1.2, opacity: 0, ease: Cubic.easeOut});
        }
        page.change=function(){
            // TweenMax.to(bg.position,1,{x:800,ease:Cubic.easeOut});
            // TweenMax.to(bg.scale,1,{x:10,y:10,ease:Cubic.easeOut});
            scene.remove(bg);
        }
        page.Invisible=function () {
            TweenMax.to(bg.material,1,{opacity:0,ease:Cubic.easeOut});
        }



        page.DoIt=function(){
            bg.rotation.z+=0.01;
        }

        return page;

    }
}